<?php
// No direct access
defined ('_JEXEC') or die();

jimport ('joomla.application.component.modellist');

class ShipnhanhModelNotifications extends JModelList
{
	public function __construct($config = array())
	{
		parent::__construct();
	}

	function getListQuery()
	{
		$db = JFactory::getDBO();
		$query = $db->getQuery(true);
		$query->select('n.id, u.name AS username, n.date, n.orderid, n.note');
		$query->from('#__sn_notifications AS n');
		$query->join('INNER', '#__users AS u ON (n.userid = u.id)');

		$query->order($this->getState('list.ordering', 'n.date') .
				' ' . $this->getState('list.direction', 'DESC'));

		return $query;
	}
}